<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "area".
 *
 * @property integer $area_id
 * @property string $area_name
 * @property integer $area_parent_id
 * @property integer $area_sort
 * @property integer $area_deep
 */
class Area extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'area';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['area_name'], 'required'],
            [['area_parent_id', 'area_sort', 'area_deep'], 'integer'],
            [['area_name'], 'string', 'max' => 50],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'area_id' => '索引ID',
            'area_name' => '地区名称',
            'area_parent_id' => '地区父ID',
            'area_sort' => '排序',
            'area_deep' => '地区深度，从1开始',
        ];
    }
}
